package com.esri.core.renderer;

import com.esri.core.internal.util.a;
import com.esri.core.internal.util.d;
import com.esri.core.raster.FunctionRasterSource;
import com.esri.core.raster.RasterSource;
import java.io.StringWriter;
import org.codehaus.jackson.JsonGenerator;

/* loaded from: classes.dex */
public class BlendRenderer extends HillshadeRenderer {
    private static final String a = "blend";
    private RasterSource b;
    private double[] c;
    private double[] d;
    private double e = -1.0d;

    @Override // com.esri.core.renderer.HillshadeRenderer, com.esri.core.renderer.RasterRenderer
    public String toJson() throws Exception {
        StringWriter stringWriter = new StringWriter();
        JsonGenerator a2 = d.a(stringWriter);
        a2.writeStartObject();
        toJson(a2);
        a2.writeEndObject();
        a2.close();
        return stringWriter.toString();
    }

    @Override // com.esri.core.renderer.HillshadeRenderer
    protected void toJson(JsonGenerator jsonGenerator) throws Exception {
        d.a(jsonGenerator, "type", a);
        if (this.mSlopeType != null) {
            this.mSlopeType.toJson(jsonGenerator);
        }
        if (!Double.isNaN(this.mAltitude)) {
            d.a(jsonGenerator, "altitude", this.mAltitude);
        }
        if (!Double.isNaN(this.mAzimuth)) {
            d.a(jsonGenerator, "azimuth", this.mAzimuth);
        }
        if (!Double.isNaN(this.mZFactor)) {
            d.a(jsonGenerator, "zfactor", this.mZFactor);
        }
        if (!Double.isNaN(this.mPixelSizeFactor)) {
            d.a(jsonGenerator, "pixelSizeFactor", this.mPixelSizeFactor);
        }
        if (!Double.isNaN(this.mPixelSizePower)) {
            d.a(jsonGenerator, "pixelSizePower", this.mPixelSizePower);
        }
        if (!Double.isNaN(this.e)) {
            d.a(jsonGenerator, "gamma", this.e);
        }
        if (!a.a(this.c)) {
            d.a(jsonGenerator, "minValues", this.c);
        }
        if (!a.a(this.d)) {
            d.a(jsonGenerator, "maxValues", this.d);
        }
        RasterSource rasterSource = this.b;
        if (rasterSource == null || rasterSource.getId() == 0) {
            return;
        }
        d.a(jsonGenerator, "elevationSource", this.b.getId());
    }

    public RasterSource getElevationSource() {
        return this.b;
    }

    public void setElevationSource(RasterSource rasterSource) {
        if (rasterSource instanceof FunctionRasterSource) {
            System.out.println("At the 10.2.4 release, BlendRenderer only supports FileRasterSources as elevation sources.");
        } else {
            this.b = rasterSource;
        }
    }

    public double[] getMinValues() {
        return this.c;
    }

    public void setMinValues(double[] dArr) {
        this.c = dArr;
    }

    public double[] getMaxValues() {
        return this.d;
    }

    public void setMaxValues(double[] dArr) {
        this.d = dArr;
    }

    public double getGamma() {
        return this.e;
    }

    public void setGamma(double d) {
        this.e = d;
    }
}
